using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NEM
{

    [Serializable]
    public class ApplicationSettings
    {
        #region Private Variables / Constants

        #endregion

        #region Constructors
        public ApplicationSettings()
        {

        }
        #endregion

        #region Properties

        #region SaveConfigurationType

        private SaveType _MainSaveType = SaveType.Registry;
        [Category("Configuration Saving")]
        [DisplayName("1 - Save Method")]
        [Description("Select if settings should be saved to File or Registry.")]
        public SaveType MainSaveType
        {
            get { return _MainSaveType; }
            set { _MainSaveType = value; }
        }

        #endregion

        #region Network Connection Settings
        private bool _OnlyIPEnabled = true;
        [Category("Network Connection Settings")]
        [DisplayName("IP Enabled only")]
        [Description("Show Only IP Enabled Network Connections or All Connections like VMWare connection VPN Connection etc..")]
        public bool OnlyIPEnabled
        {
            get { return _OnlyIPEnabled; }
            set { _OnlyIPEnabled = value; }
        }

        #endregion

        #region Logging 
        
        private bool _EnableLog = new bool();
        [Category("Log Settings")]
        [DisplayName("1 -Enable Log")]
        [Description("Will Log event that occur in this Application.")]
        public bool EnableLog
        {
            get { return _EnableLog; }
            set { _EnableLog = value; }
        }

        private String _LogFolderPath = string.Empty;
        [Category("Log Settings")]
        [DisplayName("2 - Log Folder Path")]
        [Description("The Folder Path to where the log should be written. If Blank it will write to Application location.")]
        public String LogFolderPath
        {
            get { return _LogFolderPath; }
            set { _LogFolderPath = value; }
        }

        private String _LogFileName = string.Empty;
        [Category("Log Settings")]
        [DisplayName("3 - Log File Name")]
        [Description("Name of the log file.")]
        public String LogFileName
        {
            get { return _LogFileName; }
            set { _LogFileName = value; }
        }

        #endregion 

        #region Notifications
        private bool _StartHiddenForm = new bool();
        [Category("Startup")]
        [DisplayName("Start Hidden")]
        [Description("Start the application with the Form Hidden.")]
        public bool StartHidden
        {
            get { return _StartHiddenForm; }
            set { _StartHiddenForm = value; }
        }

        private Notifications _NotificationSettings = new Notifications();
        [Category("Notifications")]
        [DisplayName("Notification Settings")]
        [Description("Default Notification Settings.")]
        [TypeConverter(typeof(ExpandableObjectConverter))]
        public Notifications NotificationSettings
        {
            get { return _NotificationSettings; }
            set { _NotificationSettings = value; }
        }
        #endregion End Notifications

        #region General Settings

        private bool _AutoStart = true;
        [Category("General Settings")]
        [DisplayName("Automatically Start Application")]
        [Description("On windows startup Start this Application.")]
        public bool AutoStart
        {
            get { return _AutoStart; }
            set { _AutoStart = value; }
        }

        #endregion End General Settings


        #endregion End Properties

        #region Methods

        #endregion

        #region Overrides
        public override string ToString()
        {
            return "Application Settings";
        }
        #endregion
    }

    public enum SaveType
    {
        Registry,
        File
    };

    [Serializable]
    public class Notifications
    {
        #region Private Variables / Constants

        #endregion

        #region Constructors
        public Notifications()
        {

        }
        #endregion

        #region Properties

        private bool _Enable = true;
        [Category("Notifications")]
        [DisplayName("1 - Default Enabled")]
        [Description("Should Notification be Enabled by default.")]
        public bool Enable
        {
            get { return _Enable; }
            set { _Enable = value; }
        }

        private int _ShowTime = 1500;
        [Category("Notifications")]
        [DisplayName("2 - Default ShowTime")]
        [Description("Default time to show the pop-up.")]
        public int ShowTIme
        {
            get { return _ShowTime; }
            set { _ShowTime = value; }
        }

        #endregion

        #region Methods

        #endregion

        #region Overrides
        public override string ToString()
        {
            return "Notification Settings";
        }
        #endregion
    }

}
